package com.example.yin.dao;

import com.example.yin.domain.Consumer;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ConsumerMapper {

    int deleteByPrimaryKey(Integer id);
    int insert(Consumer record);
    int insertSelective(Consumer record);
    Consumer selectById(Integer id);
    int updateByPrimaryKeySelective(Consumer record);

    int updateById(Consumer record);//根据用户id更新用户信息
    boolean addUser(Consumer consumer);//用户注册
    Consumer userLogin(@Param("username") String username, @Param("password") String password);//用户登录
    boolean userLogout(@Param("id")Integer id);
    List<Consumer> loginStatus(String username);
    int updateUserAvator(Consumer record);




    /*admin module*/

    List<Consumer> allUser();//返回所有用户

    int verifyPassword(String username, String password);

    int existUsername(String username);

    int updateByPrimaryKey(Consumer record);

    int deleteUser(Integer id);

    List<Consumer> userOfId(Integer id);

    List<Consumer> userOfName(String username);

    int updateUserMsg(Consumer record);

//    int updateUserAvator(Consumer record);

}
